CFWRAP 1.1 -- Word Wrapping Tuned for BBS Capture Files Copyright (c) 1994 by David M. Wincelberg Table of Contents I. Introduction ................................................. 1 II. Suggestions for Use .......................................... 2 III. Suitable Tasks for CFWRAP, With Instructions ................. 2 IV. Program Improvements ......................................... 4 Appendices: A. Command line switches ........................................ 4 B. Initialization (.INI) file ................................... 5 C. Troubleshooting .............................................. 7 D. Recognized Paragraph Types ................................... 8 E. Definitions .................................................. 9 F. Other FileJockey Software Products ........................... 9 G. License Agreement ........................................... 10 I. Introduction Thank you for trying CFWRAP. This program prepares BBS capture files for editing by removing page pause lines ("Press for more !", etc.) and word-wrapping various types of paragraphs (including each line starting with ">>" and indented paragraphs). Many page pause lines are in a user-changeable .INI file. Version 1.1 improvements include multi-BBS support, better word wrapping, dialog boxes and mouse support. This program is safe to run on a Pentium processor since, as far as I am able to determine, it does not perform any floating point divisions of large numbers. Another safety feature of this program is its exclusion of files with user-specified extensions. Thus, one can use wildcards and include subdirectories without ruining .EXE and .ZIP files. If you run CFWRAP on this file (CFWRAP.TXT), you will notice that the table of contents is distorted. The reason is that it looks like an ordinary paragraph to CFWRAP. It is not included as a recognized paragraph type since a table of contents in that form is not likely to be printed by a bulletin board. If you find an example where this does appear on a bulletin board, please send a capture file containing it by CompuServe (not Internet) e-mail to me at 71573,1023. If you decide to keep this program after 30 days, you are required to pay the $15 license and registration fee in order to use this program legally, receive technical support and be notified of updates and bug fixes. Otherwise, you may NOT keep the individual files on your PC but you may keep the .ZIP file. A registration form is provided for you in the file CFWRAP.REG. Please make your check or money order for $15 payable to David Wincelberg and mail it to David Wincelberg FileJockey Software 289 S. Robertson Blvd., #373 Beverly Hills, CA 90211 Send comments, suggestions and problem reports to me at 71573,1023 by CompuServe (not Internet) e-mail or at the above postal address. I plan to read each one, but, if I receive a large amount of mail, I may not be able to reply to each letter. You may share this program with others. Please tell the recipient(s) that the amount you are charging, if any, does not include the license and registration fee and include the original initialization (.INI) and documentation files. This product is not available directly from me. It is only available from bulletin boards, friends, shareware distributors, etc. CFWRAP requires DOS 2.1 or higher. Although some program functions require a higher DOS version, these functions may be bypassed or will ask you for assistance. See the troubleshooting guide for further information. II. Suggestions for Use Let the program save original files with the BAK extension. This is the default setting. It is a good idea to review new files before deleting original ones since unrecognized paragraph types might not be handled properly. If you find a paragraph type that should be handled, please e-mail me a sample with a brief description of what it is and what forum or command generated it. Review the list of file extensions in the [Exclude] section of CFWRAP.INI. CFWRAP will skip files with these extensions. If the list is OK, then you may wish to process groups of files and include sub-directories. III. Suitable Tasks for CFWRAP, With Instructions A. Prepare a CompuServe capture file for editing This is the main purpose of CFWRAP. The simplest use is: CFWRAP filename where filename is the name of a capture file. The program removes page pause lines and word-wraps the remainder of the file while connecting paragraphs split by pause lines. B. Remove page pause (or other designated) lines This is one of the main aspects of CFWRAP. The lines that are removed are defined in CFWRAP.INI. These lines do not have to be pause lines. They can be any lines up to about 115 characters not containing semicolons. (But you may change the data separator character. See Appendix B.) As above, run the program with: CFWRAP filename C. Word wrap This is the other main aspect of CFWRAP. It is invoked by CFWRAP /nn filename where /nn is an optional parameter to override the maximum line length specified in CFWRAP.INI. An example is: CFWRAP /45 file_id.diz There is also a parameter MinWrapStartLength in CFWRAP.INI, with a default value of 60, which specifies when a line is long enough to start word wrapping. For example, you may wish to word-wrap a paragraph even though the first line does not exceed the maximum line length. CFWRAP breaks or connects hyphenated words when appropriate for word wrapping. D. Right justify text Enter: CFWRAP /J filename Only lines in a paragraph that is word-wrapped will be justified, except for its last line. E. Process groups of file safely As noted above, CFWRAP will not process files whose extensions are on any of the lists of the [Exclude] section of CFWRAP.INI. These lists are grouped by program type to make it easier for you to check that you are excluding the extensions for your applications. As a result, you don't have to worry about accidentally changing files that have ZIP, EXE or many other common binary formats. Thus, you can enter: CFWRAP /S *.* to clean and word-wrap all suitable files in the current directory and any subdirectories. In addition, you can restrict the program to operate on files from a specified date by adding /D:mm-dd-yy to the options and you can instruct the program to ask before cleaning each file using /P: CFWRAP /S /D:8-1-94 /P *.* By default, the program makes a backup of all files that are changed. As a result, you can recover any file that is not processed to your satisfaction. F. Count long lines without changing the files Enter: CFWRAP /C filename(s) This is useful for checking that lines will not be wrapped when files, such those containing program source code, are brought into a word processor for printing. G. Prepare text files for use in a word processor Enter: CFWRAP /U filename(s) Alternatively, you could set MinWrapStartLength low (such as 5) and MaxLineLength high (such as 10000) in the [General] section of CFWRAP.INI. Note that some word processors have an input text reformatting feature. H. Process files captured from other on-line services To do so, you must add page pause line data to CFWRAP.INI. Version 1.1 allows you to add data for other services while keeping the CompuServe data in the .INI file. In addition, if you do not specify a selected service, CFWRAP will prompt you for one to apply to all the files to be processed for that program run. See below for descriptions of the parts of the .INI file. IV. Program Improvements Version 1.1 changes include multi-BBS support, better word wrapping, dialog boxes, mouse support, graphical error/interrupt handling and prompting for input. Multi-BBS support means that CFWRAP.INI can contain page pause lines for several bulletin board services. You can specify in the .INI which set of data the program should use or you can leave blank the Selected entry in the .INI Services section so that CFWRAP will prompt you with a pick list that allows mouse use. Better word wrapping consists of improved hyphen handling and an exception list for two spaces after a period. This exception list consists of Mr., Ms., Mrs., Dr., and etc. and can be supplemented. Right justifying now handles hanging paragraphs such as those in Appendix B. In addition, several bugs, including those with right justifying, were fixed. Instead of printing questions to the screen, the program now pops up dialog boxes. For example, if you just enter CFWRAP, the program will display a box showing the command line summary and asking you to enter file names and switches. Other occasions include prompting you with a dialog box containing buttons and allowing mouse use when you have selected the /P option. This dialog box includes buttons to approve or to skip the remainder of a set of files as well as to exit the program. The program now uses dialog boxes with buttons and mouse support to handle user interrupts ( or -C) and hardware problems such as a write-protected or full floppy disks. Other changes include using the directory specified by the TEMP variable, if provided, for temporary files and a command line option to record the list of changed files in CFWRAP.LST. This file will appear in the directory from which you ran CFWRAP. Appendices A. Command line switches Entering CFWRAP /? produces the following summary of command line switches (called options). Examples of using CFWRAP are given in section III above. Switches apply to all specified files and may precede or follow filenames. Clean Up and Word-Wrap Capture Files Usage: CFWRAP [options] file1 ... [options] /nn Line limit in characters (default is 75) /S Look for matching file names also in subdirectories /D:mm-dd-yy Operate on files from date mm-dd-yy /B Save original files with extension changed to BAK /B- Don't save original files /P Prompt for confirmation before cleaning each file /J Right justify paragraph lines /C Count, but don't modify, lines longer than limit /U Unwrap: prepare file(s) for use by a word processor /R Record names of changed files in CFWRAP.LST file1 ... File(s) to be cleaned up (wildcards OK) Most of these options are self-explanatory. The back up name of a file is its base name with its extension changed to BAK. If a file with this name exists, the program will append numbers to the base name or increment a number found at the end of the base name until it finds an available name or gives up after trying up to ten million possibilities. In some cases, the program will replace letters of the base name, beyond the first one, with numbers. B. Initialization (.INI) file The program looks for CFWRAP.INI in the directory containing CFWRAP.EXE or in the root directory of the current drive (for DOS 2.x). This file is divided into sections with each section headed by a word in brackets. Following this are lines for data entries that consist of a word, an equal sign and data. Note that CFWRAP makes a backup copy of an .INI file and names it CFWRAP.BAK the first time the program detects it is being run from another computer. Below is a description of each data entry in each section. [General] MaxLineLength=75 Maximum line length for output file. You can override it with the /nn switch MinWrapStartLength=60 Line length for starting word wrapping MaxAdjacentBlankLines=2 Maximum number of blank lines that may appear together ArraySize=1024 Maximum size of input lines (minus two). CFWRAP will ask you to increase it if it is too small. MinHangingIndent=16 (Hidden option) Minimum indent of second paragraph line for CFWRAP to recognize a hanging paragraph. TwoSpaceTest=on (Hidden option) Put two spaces after a sentence when word wrapping. Tests for `.', `!', or `?' at end of a word or just before `)', `'', or `"'. Also checks words defined by [OneSpaceList] for exceptions. SaveOriginal=on (Hidden option) Save original file with BAK extension SepChar=; (Hidden option) Data separator character used below. [Services] Selected=CompuServe Specifies the set of page pause line data to use. If left blank or this line is not included, the program will prompt the user with a pick list of BBSs taken from the next entry. BBSList=CompuServe;None Specifies list of BBSs to select from. This list may contain up to 30 names but the line length is limited to 127 characters, including the entry name and equal sign. [CompuServe] Page pause line data for CompuServe. FullLine=off When on, CFWRAP considers entire input lines for equality tests. Otherwise, a line matches if it starts with one of the Skip entries. Skip1, Skip2, etc. Page pause lines to remove. The format is "pause_line;b;f;p" where b is the number of preceding blank lines to skip, f is the number of following lines, not necessarily blank, to skip when a full input line matches this page pause line, and p is the number of lines to skip when only part of an input line matches all of this pause line. When p is not included, its value is set to f. Proper setting of these numbers allows for reconnecting paragraphs split by page pause lines. [Exclude] This section lists extensions to be used for excluding files from processing. The entry names should assist you in specifying all relevant extensions. There is no effect to putting an extension in the wrong group since all of them are mixed together by CFWRAP. [ParLeaders] This section lists non-space characters that may precede each line of a paragraph. The program will keep these characters at the beginning of lines. Do not include any spaces in the leaders. CFWRAP will match the number of spaces before leaders. A paragraph leader that is contained in another one must not precede it. Thus, ">" must not precede ">>". Leader1, Leader2, etc. Entries for specifying leaders. [OneSpaceList] List of words ending in a period which do not signal the end of sentence. When word wrapping, CFWRAP puts one space after these words. Word1, Word2, etc. Entries for one space list. [ProgLineDetectChars] CFWRAP will attempt to exclude computer program lines from word wrapping. AtStart=#/ Non-blank characters at the beginning of lines. AtEnd=;/){\ Non-blank characters at the end of lines. Numbers=off Should detect numbered Fortran lines FTComments=off Should detect Fortran comment lines -- lines starting with a C or D followed by a space [New User] SkipNewUser=off Set to "on", "yes" or "1" to skip the welcome message. VolCSerNo= Serial number for drive C. Used by the welcome message routine to detect running CFWRAP on a different computer. C. Troubleshooting Repeated welcome messages: Set "SkipNewUser=on" in the [New User] section of CFWRAP.INI. Although the new user detection routine requires DOS 4.0 or higher, it should work satisfactorily when it starts with the original CFWRAP.INI file and subsequently uses the updated file that it creates. The original CFWRAP.INI is saved as CFWRAP.BAK. Files skipped: Check if the file extensions are on any of the lists in the [Exclude] section of CFWRAP.INI. If so, rename the files or remove those extensions from the lists. Otherwise if the /D switch was used, check if the file dates are before the specified date. Another possibility is that the file was not changed. In that case, the file is restored to its original name and this name is removed from the screen. Out of memory: Finish any programs that you are running and try CFWRAP again. Directory errors: File read/write errors: Try a disk repair utility to fix your disk. There are now such utilities in recent versions of DOS. For serious problems, you may wish to consider a third party product. Missing or can't find CFWRAP.INI: Chances are you are using DOS 2.x. In this case, the program cannot find where it is running from and looks for the .INI file on the root of the default directory. So, copy CFWRAP.INI to the root of each disk from which you will be running the program. CFWRAP does not work on some or all of my text file: If the bad part is small, use a text editor to copy the original of this part into the processed file. If the entire file is messed up and the extension is associated with a program, add that extension to the [Exclude] section of CFWRAP.INI. If the file is a CompuServe capture file and the segment in question is frequently generated by the service, please send a sample to me at 71573,1023 by CompuServe e- mail. D. Recognized Paragraph Types The types of paragraphs that CFWRAP can recognize and handle properly include indented paragraphs, hanging paragraphs, paragraphs separated by blank lines, user input lines, simple tables, long library listings and paragraphs in which each line starts with a defined leader. Some of these are described below. User input lines start with a number followed by a colon. An example of generating such lines is when one uses Compose to write a message. Simple tables start with a line of dashes and contain the vertical symbol (|) in each following line that does not start with dashes. The table is assumed to use no more than 80 columns. Long library listings start with the words "Title" and "Keywords" at the beginning of the first two lines and are followed by one or more paragraphs with a two space left margin. This format is used for long descriptions of files available for downloading. Some message writers use ">>" or ">" before each line in a message that is copied from a message the writer is responding to. Paragraphs that start with defined symbols can be word-wrapped while keeping the symbols at or near the left margin, depending how the symbols are used for that paragraph in the input file. As mentioned above, paragraph leaders are defined in the [ParLeaders] section of CFWRAP.INI and cannot be part of a leader that follows in this section. For example, ">" must not precede ">>." Hanging paragraphs are included so that running CFWRAP on this file only distorts the table of contents. A hanging paragraph is distinguished from an indented paragraph by requiring that the second line be indented at least 16 spaces and that the preceding line be blank or the end of another hanging paragraph. The required indent may be changed by adding the line "MinHangingIndent=nn" to the [General] section of CFWRAP.INI where nn is a whole number. E. Definitions Base name: The characters of a filename before the period, if any. There must be one to eight characters in the base name. Capture file: This is a record of what transpires during a bulletin board session. It consists of what you type and what the bulletin board computer types on your screen. Extension: The characters of a filename after the period, if any. The extension may consist of zero to three characters. Page pause line: This is a line inserted by the bulletin board computer to stop the output from scrolling off the screen before you can read it. It is also used to request user commands. Typically, it is preceded by one or more blank lines and is followed by several lines that remind you what service or function you are using. F. Other FileJockey Products Following is a list of current FileJockey Software products. All of the compressed files for these products have extension ZIP. In parentheses is the location where the program may be found on CompuServe and the registration/license fee. PROGCR 1.0 -- Prepares Programs for Copyrighting Protects the privacy of your C/C++ or PASCAL source code copyright deposit by removing comments after each file's header (which should primarily consist of your copyright notice) from copies of the original files. Also, copies words displayed by standard or user- specified print commands to a file for spell checking. Pentium safe. (GO IBMPRO, Library 6, $10): G. License Agreement This is a legal agreement between you ("Licensee") and FileJockey Software ("Licensor"). Licensor owns all worldwide rights, title, copyright and other interests in and to the computer program identified as CFWRAP 1.1 ("Software"). By using the Software, you are agreeing to be bound by the following terms: 1. Licensor grants to Licensee the non-exclusive and non-assignable right to use the Software for a period of 30 days without paying a fee to Licensor. After 30 days, Licensee may continue this right by paying $15 to Licensor. 2. Licensee may distribute copies of the Software and related files to others provided Licensee informs the recipients that the Software is subject to a license agreement and that the fee you charge, if any, does not include the $15 license fee. 3. Licensor hereby alerts Licensee that the Software, accompanying documentation, and the initialization (.INI) file are provided "AS IS" without warranty of any kind. Licensor assumes all risks involving use of the Software and its results and performance. 4. Licensee hereby acknowledges that Licensor bears no responsibility or liability which may arise or result from Licensee's use of the Software. Licensee hereby waives and releases Licensor from any and all claims for damages, losses and costs therefrom. In no event shall Licensor's liability for any damages ever exceed the price paid for license and registration, regardless of the form of the claim. 5. This license agreement shall be construed and enforced in accordance with the laws of the State of California. This agreement may not be modified except by written instrument signed by both parties. If any provisions of this agreement are found to be invalid or unenforceable by the operation of the law, then invalidity or unenforceability of such provision(s) shall not affect the validity or enforceability of the other provisions of this agreement. Any dispute arising from this agreement shall be submitted to California courts located in Los Angeles County, and Licensee hereby submits to the jurisdiction of such courts. All (registered) trademarks and (registered) service marks are property of their respective companies.